import json
from datetime import datetime
d1 = {"a": False, "b": True, "date": datetime.now()}


def save():
    with open("D:\\learn_and_test_data\\json_test.json", mode="w+", encoding="UTF-8") as f:
        json.dump(
            d1,
            f,
            indent=4,
            ensure_ascii=False
        )


def load():
    with open("D:\\learn_and_test_data\\json_test.json", mode="r", encoding="UTF-8") as f:
        data = json.load(f)
    return data


if __name__ == '__main__':
    print(d1)
    save()
    d = load()
    print(d)
